home *** CD-ROM | disk | FTP | other *** search
-
- #include <stdio.h>
- #include <stdlib.h>
-
- #define NUMELEMENTS(x) (sizeof(x)/sizeof(x[0]))
- #define INT 1
- #define LONG 2
- #define DOUBLE 3
-
- typedef struct {
- const char *stack_name;
- void *pstack;
- const int type; /* type of entries */
- size_t stack_ptr;
- size_t max_stack;
- } stack;
-
- int array1[10];
- static long array2[30];
-
- stack stack1 = {"stack1", array1, INT, 0, NUMELEMENTS(array1)};
- stack stack2 = {"stack2", array2, LONG, 0, NUMELEMENTS(array2)};
- stack stack3 = {"stack3", NULL, DOUBLE, 0, 0};
-
-